import subprocess
import time
from tool.get_environment import set_report_xml_on_jenkins


def init_run():
    cmd  ='pytest -sv --alluredir=/var/jenkins_home/workspace/demo_001/allure_html   --clean-alluredir'
    subprocess.call(cmd, shell=True)
    set_report_xml_on_jenkins()

# def init_report():
#     set_report_xml_on_jenkins()
#     #TODO 使用allure generate -o 命令将./report目录下的临时报告生成到./report目录下变成html报告
#     time1=time.strftime("%Y%m%d-%H%M%S")
#     cmd = "allure generate report/ -o report/{}.html --clean".format(time1)
#     subprocess.call(cmd, shell=True)

init_run()
# init_report()